package pref.junx.flybird.activity.note;

import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import pref.junx.flybird.R;
import pref.junx.flybird.base.BaseActicvitylhy;


/**
 * Created by 半生瓜 on 2017/8/7.
 */

public class NoteActvity extends BaseActicvitylhy<notePresenter, noteModel> implements noteConteact.View {

    EditText ED_note;
    TextView finish_note;
    TextView ok_note;
    @Override
    public int getLayoutId() {
        return R.layout.note_layout_incloud;
    }

    @Override
    public void initview() {
        ED_note=(EditText)findViewById(R.id.ED_note);
        finish_note=(TextView) findViewById(R.id.finish_note);
        ok_note=(TextView) findViewById(R.id.ok_note);
        ED_note.setOnClickListener(this);
        finish_note.setOnClickListener(this);
        ok_note.setOnClickListener(this);
    }

    @Override
    public void processClick(View view) {
   switch (view.getId()){
       case R.id.finish_note:
           finish();
           break;

       case R.id.ok_note:
            savevcalue(ED_note.getText().toString().trim());
           finish();
           t.show_l("保存成功");
           break;


   }

    }

    private void savevcalue(String trim) {
        spTools.setString("note",trim);
    }


    @Override
    public void init() {
        getvalue();
    }


    @Override
    public void success() {

    }

    @Override
    public void result(String a) {

    }

    public void getvalue() {
     ED_note.setText(spTools.getString("note"));

    }
}


